package com.situ.crm.proxy;

import org.junit.Test;

public class Client {
	public static void main(String[] args) {
		DongShiZhang dongShiZhang = new DongShiZhang();
		// 在客户端，客户调用的是秘书的签字功能
		IQianZi qianZi = new MiShu(dongShiZhang);
		qianZi.qianzi();
	}

	@Test
	public void test() {
		IQianZi dongShiZhang = new DongShiZhang();
		IQianZi proxy = (IQianZi) ProxyFactory.getProxyInstance(dongShiZhang);
		proxy.qianzi();
	}

	@Test
	public void test2() {
		IUserService userService = new UserServiceImpl();
		// 动态代理帮我们实现了一个实现IUserService接口的代理类
		IUserService proxyService = (IUserService) ProxyFactory.getProxyInstance(userService);
		proxyService.selectById();
		proxyService.deleteAll();
	}
}
